<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qtsoap.cpp -->
<head>
  <title>QtSoapNamespaces Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">QtSoapNamespaces Class Reference</h1>
<p>The QtSoapNamespaces class provides a registry for XML namespaces and prefixes for use in QtSoap. <a href="#details">More...</a></p>
<pre> #include &lt;QtSoapNamespaces&gt;</pre><ul>
<li><a href="qtsoapnamespaces-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtsoapnamespaces.html#prefixFor">prefixFor</a></b> ( const QString &amp; <i>uri</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsoapnamespaces.html#registerNamespace">registerNamespace</a></b> ( const QString &amp; <i>prefix</i>, const QString &amp; <i>uri</i> )</td></tr>
</table>
<hr />
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QtSoapNamespaces &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qtsoapnamespaces.html#instance">instance</a></b> ()</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QtSoapNamespaces class provides a registry for XML namespaces and prefixes for use in QtSoap.</p>
<p>When a <a href="qtsoapmessage.html">QtSoapMessage</a> is converted to XML via <a href="qtsoapmessage.html#toXmlString">QtSoapMessage::toXmlString</a>(), this class is used to find appropriate XML namespace prefixes for the QNames (qualified names) in the message.</p>
<p>To register a namespace with a prefix, call register(). <a href="qtsoapnamespaces.html#prefixFor">prefixFor</a>() will then return the prefix that is registered for the given namespace, if any.</p>
<p>To access the QtSoapNamespaces registry, call <a href="qtsoapnamespaces.html#instance">QtSoapNamespaces::instance</a>().</p>
<pre> QtSoapNamespaces &amp;registry = QtSoapNamespaces::instance();

 registry.register(&quot;pre&quot;, &quot;http:<span class="comment">//www.example.com/&quot;);</span>
 QString prefix = registry.prefixFor(&quot;http:<span class="comment">//www.example.com/&quot;); // returns &quot;pre&quot;</span></pre>
<p>See also <a href="qtsoapmessage.html">QtSoapMessage</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="instance"></a>QtSoapNamespaces &amp; QtSoapNamespaces::instance ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns a reference to the <a href="qtsoapnamespaces.html">QtSoapNamespaces</a> singleton.</p>
<h3 class="fn"><a name="prefixFor"></a><a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> QtSoapNamespaces::prefixFor ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> &amp; <i>uri</i> )</h3>
<p>Returns the prefix for the namespace <i>uri</i>, or an empty string if no prefix has been registered for <i>uri</i>.</p>
<h3 class="fn"><a name="registerNamespace"></a>void QtSoapNamespaces::registerNamespace ( const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> &amp; <i>prefix</i>, const <a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> &amp; <i>uri</i> )</h3>
<p>Registers the namespace <i>uri</i> with the prefix <i>prefix</i>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
